<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ page isELIgnored='false'%>
<script language="JavaScript" type="text/javascript">

function getURLParam(strParamName){
  var strReturn = "";
  var strHref = window.location.href;
  if ( strHref.indexOf("?") > -1 ){
    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
      if (
aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return unescape(strReturn);
}

function filterAction()
{
   window.location.href = 
  "dalabellist.html" +
    "?daSchemeId=" + document.filterForm.filterSelector.options[document.filterForm.filterSelector.selectedIndex].value;  
}
 
function initFilter()
{
  var idParam = getURLParam("daSchemeId");

  if (idParam)
	  idParam = 145;
  
  for (i = 0; i < document.filterForm.filterSelector.length; i++)
  {
    var option = document.filterForm.filterSelector.options[i];
    if (option.value == idParam)
    {      
    	  document.filterForm.filterSelector.selectedIndex = option.index;
    } else {
    	  document.filterForm.filterSelector.selectedIndex = 4;
          // document.dalabelFilterForm.dalabelFilterSelector.selectedIndex = 0;
    }
  }
}
</script>

<div class="filter">
<table>
  <tr>
    <th>Display Dialogue Act Labels in:</th>
    <td>
    <form name="filterForm"><select
      name="filterSelector" onchange="filterAction();"
      value="5">
      <!--   option value=''>Any</option -->
      <c:forEach items="${da_schemes}" var="dascheme">
        <option value='<c:out value="${dascheme.dialogueActSchemeId}"/>'>
        <c:out value="${dascheme.scheme}" /></option>
      </c:forEach>
    </select></form>
    </td>
  </tr>
  <tr>
    <th>Number of dialogue act labels:</th>
    <td><c:out value="${fn:length(da_labels)}" /></td>
  </tr>
</table>
</div>
